﻿@model ShippingMethodModel

<div class="layui-col-md12">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-form" wid100 lay-filter="">
                <input asp-for="Id" type="hidden" />
                <div class="layui-form-item">
                    <u-label asp-for="Name" />
                    <div class="layui-input-inline">
                        <u-editor asp-for="Name" />
                        <span asp-validation-for="Name"></span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <u-label asp-for="Description" />
                    <div class="layui-input-inline">
                        <u-textarea asp-for="Description" style="width:320px;height:100px;" />
                        <span asp-validation-for="Description"></span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <u-label asp-for="DisplayOrder" />
                    <div class="layui-input-inline">
                        <u-editor asp-for="DisplayOrder" />
                        <span asp-validation-for="DisplayOrder"></span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button id="layuiadmin-app-form-submit" style="display:none" class="layui-btn" lay-submit lay-filter="set_system_submit_btn">确认保存</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set'], function () {
        var $ = layui.$
            , form = layui.form
            ,active = {
            test: function () {
                layer.open({
                    type: 2
                    , title: '系统信息'
                    , content: ''
                    , area: ['400px', '300px']
                    , btn: ['确定', '取消']
                    , yes: function (index, layero) {
                        //点击确认触发 iframe 内容中的按钮提交
                        var submit = layero.find('iframe').contents().find("#layuiadmin-app-form-submit");
                        submit.click();
                    }
                });
            }
            }
        form.on('submit(set_system_submit_btn)', function (obj) {
          var field = obj.field; //获取提交的字段
            field.Description = ue.getContent();
            $.post('@Url.Action("EditMethod")', field, function (rep) {
                if (rep.success==1)
              layer.msg('保存成功');
            });
            return false;
    });
        $('.layui-btn.layuiadmin-btn-tags').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });

</script>